package cn.iocoder.yudao.module.member.user.vo;

import cn.iocoder.yudao.framework.region.vo.setter.CountyAutoSetter;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 前台用户 Response VO")
@Data
public class MemberUserRespVO extends MemberUserBaseVO implements CountyAutoSetter {

    @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23788")
    private Long id;

    @Schema(description = "注册 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1")
    private String registerIp;

    @Schema(description = "最后登录IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1")
    private String loginIp;

    @Schema(description = "最后登录时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime loginDate;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;

    @Schema(description = "用户标签", example = "购物达人, 程序员")
    private List<String> tagNames;

    @Schema(description = "用户等级", example = "黄金用户")
    private String levelName;

    @Schema(description = "省份名称", example = "贵州省")
    private String provinceName;

    public String getProvinceName() {
        if (provinceName == null) {
            provinceName = "";
        }
        return provinceName;
    }

    @Schema(description = "城市名称", example = "贵阳市")
    private String cityName;

    public String getCityName() {
        if (cityName == null) {
            cityName = "";
        }
        return cityName;
    }

    @Schema(description = "区县名称", example = "南明区")
    private String countyName;

    public String getCountyName() {
        if (countyName == null) {
            countyName = "";
        }
        return countyName;
    }

    @SuppressWarnings("unused")
    public String getFullAddress() {
        return getProvinceName() + getCityName() + getCountyName();
    }

}
